package com.yohann.designPattern.visitor;

/**
 * <p>
 * 客户端
 * </p>
 *
 * @author Yohann
 * @since 2021/2/11 17:00
 */
public class Client {
    public static void main(String[] args) {
        ObjectStructure structure = new ObjectStructure();
        structure.attach(new Man());
        structure.attach(new Woman());

        Action success = new Success();
        Action fail = new Fail();

        /*
        man:success
        woman:success
         */
        structure.display(success);

        /*
        man:fail
        woman:fail
         */
        structure.display(fail);

        /*
        man:wait
        woman:wait
         */
        Action wait = new Wait();
        structure.display(wait);
    }
}